package RoomManagement

import (
	"MedicalTreatment/global"
	"MedicalTreatment/model"
	"github.com/gin-gonic/gin"
)

func InpatientInquiry(r *gin.Engine) {
	r.POST("/inpatientInquiry", func(context *gin.Context) {
		var pat []model.Result
		if err := global.DB.Debug().Table("results").Where("is_hospital LIKE ?", "建议住院"+"%").Find(&pat).Error; err != nil {
			context.JSON(200, gin.H{
				"Msg": err,
			})
		} else {
			context.JSON(200, gin.H{
				"Msg": pat,
			})
		}
	})
}
